#include <stdio.h>
#include <stdlib.h>
#include "LinkedList.h"
#include <string.h>



void PrintArr(int* arr, int length)
{
	printf("[");
	for (int n = 0; n < length-1; n++)
	{
		printf("%d, ", arr[n]);
	}

	printf("%d]\n",arr[length-1]);
}

int main(int argc, char* args)
{
	int i;
	int* arr,arr2;
	LinkedList* list = newList();
	LinkedList* list2;

	for (i = 0; i < 20; i++)
	{
		addElement(list, i);
	}
	insertElement(list, 5, 55);
	removeElement(list, 5);
	list2 = listSlice(list, 2, 6);
	listCat(list2, list);
	arr2 = listToArray(list2);
	PrintArr(arr2, listLength(list2));
	return 0;
}